package com.woniuxy.jwt;

import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;

public class ParseJwt {
    public static void main(String[] args) {
        String token = "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI4MDgwIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2NDU1MjgwODIsImV4cCI6MTY0NTUyODE0MSwidXNlcm5hbWUiOiJnYW95aSIsInBhc3N3b3JkIjoxMjM0NTZ9.ZvmZEw2R_gIB_j5sHbGNMsKzk1dLCEJnZ88gI5AJYqw";
        Claims claims = Jwts.parser().setSigningKey("woniuxy").parseClaimsJws(token).getBody();
        System.out.println(claims.getId());
        System.out.println(claims.getSubject());
        System.out.println(claims.getIssuedAt());
        System.out.println(claims.get("username"));
        System.out.println(claims.get("password"));
    }
}
